﻿using InnoWeb.CEND.Core.Model.Expert;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Expert
{
    public class ExpertInfoMapping:BaseMappingConfiguration<ExpertInfo,int>
    {
        public ExpertInfoMapping()
        {
            this.Property(a => a.Name).IsRequired().HasMaxLength(50);
            this.Property(a => a.Surname).IsRequired().HasMaxLength(50);
            this.Property(a => a.ShortDescription).IsRequired().HasMaxLength(500);
            this.Property(a => a.ImageUrl).IsRequired();

            this.Ignore(a => a.FullName);

            this.HasMany(a => a.BlogItems).WithRequired(a => a.Expert);
            this.HasMany(a => a.TrainingItems).WithRequired(a => a.Expert);
            this.HasMany(a => a.WorkshopItems).WithRequired(a => a.Expert);
        }
    }
}
